Repository navigation
feat(pm): git-history ancestor and dev-worktree.sh take over two procedures os-dev retyped by hand - #38018
Conversation
…e or refuses `git merge-base --is-ancestor` answers exit 1 for a real ancestor that sits below a shallow cut. `ancestor` runs the tested leg and a control leg: a yes prints at once, a no stands only when the ref's history is complete or every graft boundary under it is older than the tested commit, and anything else deepens and then refuses with empty stdout. A proven no exits 3, so it is neither a yes nor the usage exit. Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ Co-authored-by: Claude <noreply@anthropic.com>
…ev names both readers dev-worktree.sh builds the task's worktree beside the checkout from a freshly fetched origin/main (or from origin/BRANCH at a claimed Resume-from sha), pins the base in the worktree's own git dir, sends the empty-branch probe (a 403 stops, only a network error is retried), makes the issue's scratchpad directory and runs pnpm install. A branch declared platform-assigned is never pushed, and nothing is forced. os-dev.md rule 1 and its ancestor line, and the dev-traps section they point at, keep their rule sentences and name the two scripts; both files are byte-neutral. Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ Co-authored-by: Claude <noreply@anthropic.com>
…what --pin-base pins Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ Co-authored-by: Claude <noreply@anthropic.com>
…ice7-ancestor-worktree
…ice7-ancestor-worktree Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ Contract-review-claim: session_01ASNY8UcT2uJmgTyCPnMiMZ · head e1dcc03 · 2026-11-27T19:03Z The dispatching seat runs this head's contract-tier review in an isolated at-tier sub-agent ( |
|
repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ Contract reviewServed-tier: PR #38018 (slice 7 of card #35237), reviewed at the head above against merge-base One must-fix (M1), one should-fix (S1), five nits. The two scripts are careful work and the ① Derived judgments
② Semver level
③ Boundary flagsThe PR body's three decisions:
Report 7223320514,
Report 7223320514,
SQL push-down: not applicable. The diff holds no data access, no id materialisation and no in-app join. ④ Design judgment
M1 (must-fix) — rule 1 no longer says that its script pushes, and the ⛔ on line 32 can only be obeyed with a flag the rule never names. Line 27 says of the script only that it builds the tree. Run exactly as line 27 spells it ( The script's own guard is real and tested: a name that is not the issue spelling stops with usage and says which flag a card thread takes ( This is also the done-when form of Fix, either of: (a) line 31 names the script as the probe's reading and line 32 names
Tried and held: a real ancestor below the cut with its object present (raw exit 1) is refused, then deepened to S1 (should-fix) — an unreadable boundary read is taken for a complete history, the one value that proves a negative. Nits:
Rule 1 line by line: tree from a fetched Tried and held: nothing forces (no
A fix for M1 and S1 earns a delta review at its head. Implemented-by: VERDICT: FAIL |
…y walk is never a complete history dev-worktree.sh sent the empty-branch push by default for the very spelling rule 1 prints, so a card thread's alias could be pushed under a name the platform never assigned. No spelling is probed by default now: the push needs --probe, --no-probe says the default out loud, and os-dev rule 1's probe line names the script with --probe. git-history ancestor read a failed boundary walk as an empty list, the one value that proves a negative. A walk that cannot be read is refused, a parentless commit whose parents cannot be read is an undecided boundary, the floor's control leg is run and its exit code printed, and a hex prefix that is ambiguous or names a non-commit is usage. Claude-Session: https://claude.ai/code/session_01ASNY8UcT2uJmgTyCPnMiMZ Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ Contract-review-claim: session_01ASNY8UcT2uJmgTyCPnMiMZ · head b829905 · 2026-11-27T19:49Z Delta review of fix round 1 for record 7226409572 (M1, S1), by the same isolated at-tier reviewer. The PR body was replaced with its final (non-WIP) text at this head by the seat. |
|
repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ Contract reviewServed-tier: Delta review of PR #38018 on record 7226409572 (FAIL at M1 closed. S1 closed. N1, N2 and N4 closed; N3 and N5 left as nits. Two new nits (N6, N7). No must-fix, no should-fix. ① Derived judgments
② Semver levelUnchanged. ③ Boundary flagsReport 7226877140,
SQL push-down: not applicable. ④ Design judgmentM1 — closed. Replayed on the tree. A card-thread dev who builds a tree under the spelling rule 1 prints ( Question 1 — line 194 back to
S1 — closed. Nits from the first record.
New in this round.
What the commit made me re-read, and held. No path pushes without Nits alone end the round. Implemented-by: VERDICT: PASS |
|
repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ 维护者速读
席位意见:建议批准。首轮契约审核 FAIL(7226409572:M1 默认推送与卡线程禁令冲突、S1 读不清时误判)经一轮修复全部关闭,终轮无必修、无应修;规则变更两轮都核为 席位核对ACCEPT · 2026-11-27T19:55Z · L1 · Head-sha:
|
|
repo:objectstack#8 · os-mickey · session_01ASNY8UcT2uJmgTyCPnMiMZ Landing · 2026-11-27T19:57Z · ACCEPT (seat record above) at head
Correction to the seat record above: its 维护者速读 line 「要你做什么」 says this is Tier H and needs the maintainer's approval. The tool reads Tier S, so the hand-off was refused (「Tier S 不交人」) and the owning seat lands it: |
Part of #35237
Clause-②: no
Metadata-protocol: none
Rule-change: none
Slice 7 of the card (the last slice its release notes name):
git-history ancestoranddev-worktree.sh, with theos-dev.mdpointers. The card stays open for the seat to judge its done-when across all seven slices.维护者速读
What changes
Angle-bracket placeholders of the source files are spelled as capital words below (
N,SLUG,REPO,SHA,BRANCH).1.
node scripts/pm/git-history.mjs ancestor --commit=SHA [--ref=origin/main] [--control=SHA]What it mechanises: the two-leg procedure of
references/dev-traps.md〈浅检出上的祖先读数〉.git merge-base --is-ancestoron a shallow clone fails in one direction only: exit 0 proves itself, and exit 1 is also what a shallow cut produces for a real ancestor that sits below it. The prose had a dev run a second leg by hand (a commit known to be in the ref's history, at least as deep as the tested one, must answer 0 on the same clone), deepen until it does, and read again.The command runs both legs and prints
yesornoalone on stdout, with both legs and the exit code git gave each in a one-line receipt on stderr:--control=SHAadds the operator's own leg on top. It must answer 0 and must not be newer than the tested commit (a near relative inside the shallow window is refused);touchclimbs (--deepen=Ndoubling, then--unshallow) and reads again, and refuses with exit 2 and empty stdout when the negative still cannot be told from a cut;Three decisions (each judged to hold by the contract review of the first head):
ancestor … && echo landedcannot read a no as a yes. Not 1, because 1 is this tool's usage exit. The other commands keep their exit contract.--margin-days(default 7) as slack. A history whose committer dates run backwards along ancestry defeats it; a complete clone needs no such assumption. The file header says so.2.
bash scripts/pm/dev-worktree.sh --branch=claude/issue-N-SLUG [--probe]What it mechanises: rule 1 of
os-dev.md(Worktree-first), step by step, in the rule's own order.origin/maingit fetch origin main, thengit worktree add --no-trackbeside the checkout, namedREPO-issue-Nfrom the branch (--worktree=NAMEwhen the claim names it)Resume-from: BRANCH@SHA--resume-from=BRANCH@SHA: the same-name branch fromorigin/BRANCH, after checking that its tip is that sha. The merge oforigin/mainstaysos-regen-merge.sh's; the script names itBASEbefore the first edit--baseprints it. A resumed branch pins after its merge with--pin-base. A pin is never moved--probe:git push -u origin BRANCH--no-probesays the default out loud--backoff(default 2, 4, 8, 16 s) and then given up with exit 4; any other refusal is exit 5 with no retryissue-N/under the scratchpad--scratchpad=DIRpnpm installin the tree--no-installskips it)Nothing is pushed on a spelling alone. A branch name cannot tell a self-built branch from the alias a card thread builds its tree under, so no name is probed by default. A run without
--probeprintsPROBE=skippedand the line that says what a self-built branch still owes; the same command with--probecompletes it.It never forces: no
--force, no-B, no checkout in the shared tree. An existing path, an existing local branch, or a branch already onoriginwith no--resume-fromis refused before anything is created. A second run for a tree it already built re-creates nothing, and with--probesends the probe only if the branch is still empty and absent fromorigin.The build starts from a checkout, because that is where
git worktree addruns. Every WRITE there is refused: the tree is always built beside the checkout, and--pin-baserefuses in the shared checkout.Not mechanised, and why: the merge of
origin/mainon a resume (alreadyos-regen-merge.sh); the clean-up step; a card thread whose platform branch is already checked out in the shared tree (the script refuses an existing local branch, so that case stays by hand, and now pushes nothing either way).3. The pointers
os-dev.mdgit fetch origin main && git worktree add --no-track ../REPO-issue-N -b claude/issue-N-SLUG origin/mainbash scripts/pm/dev-worktree.sh --branch=claude/issue-N-SLUG:自origin/main建../REPO-issue-N。os-dev.mdgit push -u origin BRANCH):落地标记兼写路由探针。dev-worktree.sh --probe):落地标记兼写路由探针。dev-traps.mdgit fetch --deepen/--unshallow到控制腿转 0 再重读。git-history.mjs ancestor。Every other line of rule 1 and of the dev-traps section is unchanged, the card-thread ⛔ line included. Each changed line keeps its rule sentence and names the script as its reading; only the typed command leaves.
The
os-dev.mdancestor line is back to main's text. The first head appended the reader to it. Naming the script on the probe line costs 26 bytes, the file sits at its 33504-byte ceiling, and that line was the only place the bytes could come from without cutting a rule sentence. The line still orders the dev-traps section read before any ancestor judgment, and that section's control-leg line namesgit-history.mjs ancestor. The form that keeps all three pointers was measured and fits at exactly 33504 bytes, but only by writing the probe line as 「加--probe」 with no script name, naminggit-history.mjswithout its subcommand, and droppingbashfrom the command line.Why
Rule-change: noneholds: the three lines change which command is typed, not what a dev may do, in what order, or what goes to the maintainer. The worktree is still built before any edit from a fetchedorigin/main, the base is still recorded before the first edit, the empty branch is still pushed before any edit by the dev who owns a self-built branch, a card-thread branch is still never pushed (now by default), a 403 still stops with no retry, and a negative ancestor reading still owes a control leg that answers 0.Budget:
os-dev.md356 → 356 lines, 33504 → 33500 bytes (ceiling 33504, not moved);dev-traps.md34 → 34 lines, 2627 → 2627 bytes (ceiling 2627). Whole PR: 1683 changed lines (+1671 / -12) over 5 files.4. Wiring
git-history.mjs --self-testalready runs inlint.yml's shallow-history step.dev-worktree.sh --self-testjoins the existingcheck:pm-with-fleetchain inpackage.json. No new CI job, no workflow edit.Tests
Both self-tests carry a named-battery floor and a verdict handshake.
Self-tests at b829905
The
ancestorbattery reproduces the defect first, on a 40-commit repository cloned at depth 5 (git 2.43.0):git merge-base --is-ancestor X origin/mainThe
dev-worktreeself-test builds real worktrees against a bare origin in a temp dir. Agitshim onPATHanswers the probe from a plan (403, network, other, or the real push) and counts the pushes; apnpmshim records the install.Cases added by the review round:
claude/issue-N-SLUGspelling: the tree is built, zero pushes, origin has no such branch, the base is pinned; the same command with--probethen sends one push;--no-probeis still accepted;unreadable, on the clone and the commit whose honest reading isno;--commiton a complete clone is usage (exit 1), where it was answeredno.Ablations (each through scripts/ablation-replace.mjs; mutation proven on disk, restore proven blob == HEAD)
At
b829905e0, for the review round:dev-worktree.shprobeagaingit-history.mjsno)git-history.mjsgit-history.mjsThe first attempt at the second row did not run: its anchor occurred twice in the file and the tool wrote nothing. It was re-run with a longer anchor.
At
6bf1b0608, for the first head (the graft-boundary row is superseded by the two rows above; the others still describe current code):git-history.mjsgit-history.mjs--controlnever firesgit-history.mjsdev-worktree.shdev-worktree.sh--no-probeis not honoureddev-worktree.shdev-worktree.shResume-fromsha is not compared with the tipLive readings on this container's shallow clone (one graft boundary under origin/main, dated 2026-11-16)
Taken at the first head.
d1a21fcafis this branch's own first commit, so the no is true.dev-worktree.shwas run live only on paths that write nothing to origin. A live fresh build with--probewould leave a probe branch on origin that no seat can delete, so that path is measured in the self-test only; the classifier has not seen this platform's own refusal text, and a line it cannot place readsother(exit 5, stop, no retry).Review round 1
The contract review of the first head (
e1dcc0304) answered FAIL with one mandatory finding (M1) and one recommended one (S1). Atb829905e0:--probe.unreadable(exit 2); a parentless commit whose parents cannot be read is an undecided boundary, which proves nothing.git worktree addthat fails after making the branch is refused with a verdict that names the branch it left; the refusal for a path that holds another branch names--worktree=NAME; an unpinned tree is told its base is unpinned, not that it "is no longer an empty branch".Acceptance notes
--pin-basepins HEAD. It is the base only while the tree's first edit is still ahead, and the script says so when it finds a tree it did not build.--margin-days. A complete clone is the assumption-free leg.merge-base --is-ancestoris still spelled in four reference files outside this surface (cross-repo-coordination.md,lanes/security.md,readings-queue.md,readings-shell.md). They are seat procedures, not the dev's; the seat carries them on the card.AGENTS.mdnamesgit-history.mjsfor the windowed question only. It is outside this surface and unchanged.os-dev.mdis 4 bytes under its ceiling. The ceiling row lives in the ratchet script, which is outside this surface, so it was not lowered here.os-dev.mdlists scripts among the things not ablated: each one mutates a behaviour a self-test pins.Verification
Read first (by risk):
.claude/agents/os-dev.md: two lines of rule 1 (the command line and the probe line). This is fleet rule text; judgeRule-change: nonehere.scripts/pm/dev-worktree.sh: the probe-mode default inmode_build,probe_pushandclassify_push_failure. This is the only code in the PR that writes to origin, and it runs only under--probe.scripts/pm/git-history.mjs:graftBoundaries,negativeIsProvenandancestorReading. This is the proof a no rests on.Two-minute check:
bash scripts/pm/dev-worktree.sh --self-test && node scripts/pm/git-history.mjs --self-test. Expect the two success lines quoted under Tests, exit 0, in about 15 seconds.Gates and CI at b829905